home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
manchest.lha
/
MANCHESTER
/
manchester
/
2.2
/
ctl-shift-d=2.2.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
77 lines
" NAME ctl-shift-d=2.2
AUTHOR miw@cs.man.ac.uk
FUNCTION binds screendump function to ctl-shift-d
ST-VERSIONS 2.2
PREREQUISITES
CONFLICTS
DISTRIBUTION world
VERSION 1.1
DATE 22 Jan 1989
SUMMARY ctl-shift-d binds a screendump function to the ctl-shift-d sequence.
This can be activated at any time (eg even when a menu is active)
Needs screendump.st. MIW
"!
'From Smalltalk-80, Version 2.2 of July 4, 1987 on 8 September 1987 at 9:03:11 am'!
InputState addClassVarName: 'ScreenDumpKey'!
!InputState methodsFor: 'private'!
keyAt: keyNumber put: value
| index mask |
index _ keyNumber bitAnd: 255. "Get rid of meta bits"
(index < BitMin or: [index > OtherMeta3])
ifTrue: "Not a potential special character"
[value = 1 ifTrue: "only look at down strokes"
[index = InterruptKey
ifTrue: [(lshiftState ~= 0 or: [(keyNumber bitAnd: 16r100) ~= 0])
ifTrue: [self forkEmergencyEvaluatorAt: Processor userInterruptPriority]
ifFalse: [[ScheduledControllers interruptName: 'User Interrupt'] fork]]
ifFalse: [index = EmergencyInterruptKey
ifTrue: [self forkEmergencyEvaluatorAt: Processor userInterruptPriority]
ifFalse: [index = ScreenDumpKey
ifTrue: [[self doScreenDump] forkAt: Processor userInterruptPriority]
ifFalse: [^keyboardQueue
nextPut: (KeyboardEvent
code: index
meta: (metaState bitOr: (keyNumber bitShift: -8)))]]]]]
ifFalse: [self setStateFor: index with: value.
metaState _ (((((ctrlState bitOr: (lshiftState bitOr: rshiftState)) bitOr: lockState) bitOr: metaKeyState)
bitOr: otherMetaKey1State) bitOr: otherMetaKey2State) bitOr: otherMetaKey3State]! !
!InputState class methodsFor: 'class initialization'!
initialize
"Define parameters"
"InputState initialize"
InterruptKey _ 3.
EmergencyInterruptKey _ 227.
ScreenDumpKey _ 228.
BitMin _ 128. "Min mouse/keyset bit code"
BitMax _ 135. "Max mouse/keyset bit code"
LshiftKey _ 136.
RshiftKey _ 137.
CtrlKey _ 138.
LockKey _ 139.
MetaKey _ 140.
OtherMeta1 _ 141.
OtherMeta2 _ 142.
OtherMeta3 _ 143! !
!InputState class methodsFor: 'key settings'!
screenDumpKey
"Answer the code for the key that starts an interactive screen dump"
^ScreenDumpKey!
screenDumpKey: anInteger
"Set the code for the key that starts an interactive screen dump."
ScreenDumpKey _ anInteger! !
InputState initialize!